﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace WcfMail.Interface
{
    /// <summary>
    /// 转换接口
    /// </summary>
    public interface  IConvert
    {
        /// <summary>
        /// 将当前字符串转换成指定类型的对象
        /// </summary>
        /// <param name="objectString">序列化后的字符串</param>
        /// <returns>反序列化后的对象</returns>
        T ConvertToObject<T>(string objectString);

        /// <summary>
        /// 将当前字符串转换成指定类型的对象
        /// </summary>
        /// <param name="objectString">序列化后的字符串</param>
        /// <param name="targetType">要转换的目标类型</param>
        /// <returns>反序列化后的对象</returns>
        object ConvertToObject(string objectString,Type targetType);
        /// <summary>
        /// 将目标对象转换成字符串
        /// </summary>
        /// <param name="targetObject"></param>
        /// <returns></returns>
        string ConvertToString(object  targetObject);
        ///// <summary>
        ///// 将目标对象转换成字符串,并指明目标对象的实际类型
        ///// </summary>
        ///// <param name="targetObject"></param>
        ///// <param name="targetType"></param>
        ///// <returns></returns>
        //string ConvertToString(object  targetObject,Type targetType);
    }
}
